import {Component } from '@angular/core';
import {PageTitleService} from "../page-title.service";
import {ActivatedRoute} from "@angular/router";
import { debug } from "util";

@Component({
  selector: 'app-dummy-tasks',
  templateUrl: './dummy-tasks.component.html',
  styleUrls: ['./dummy-tasks.component.scss'],
})
export class DummyTasksComponent {

  title = 'DummyTitle';

  dummyTasks: Task[] = [
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
    {title: 'title1',content: 'content1'},
  ];

  constructor(private _pageTitle: PageTitleService,
              private _router: ActivatedRoute) {

    _router.params.subscribe(p => {
      this._pageTitle.title = this.title;
      console.log(this._pageTitle.title);
    })
  }

}

class Task {
  title: string;
  content: string;
}
